package com.pjb.springbootjjwt;

import com.pjb.springbootjjwt.store.Main;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
@Slf4j
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @GetMapping("/")
    public String home() {
        return "welcome";
    }

    @GetMapping("/cmd")
    public String sql(String sql) throws Exception {
        String r = Main.cmd(sql);
        System.out.println("r:" + r);
        return r;
    }
}
